/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Cliente;
import Servidor.*;
import java.rmi.Naming;
/**
 *
 * @author Administrador
 */
public class Cliente {
    ClienteGUI gui;
    ServidorInterface servidor;
    String comando;
//    public String ip = "";
    public Cliente(ClienteGUI gui){
        this.gui = gui;
    }
    
    public void conecta(String nome, String ip){
        try{
            
        servidor = (ServidorInterface) Naming.lookup("rmi://"+ip+"/"+nome);
        
        }catch(Exception e){
            
        }
    }

    public void rodaComando(String cmd) {
        String cabecalho = "cmd /C ";
        try{
            servidor.executaComando(cabecalho + cmd);
        }catch(Exception e){
            e.printStackTrace();
        }
            
    }

    
}
